<template>
  <view class="content">
		<view class="container">
		<view class="time">
			<text class="aa">标题:</text>
			 <text>{{taskDetail.title}}</text>
			</view>
		<view class="time">
			<text class="aa">状态:</text>
			 <text>{{  taskDetail.status === 0 ? '待支付' : taskDetail.status === 1 ? '已支付' :taskDetail.status === 2 ? '服务中' : taskDetail.status === 3 ? '已完成' :taskDetail.status === 4 ? '已取消' : taskDetail.status === 5 ? '退款中' : taskDetail.status === 6 ? '已退款' :  '' }}</text>
		</view>
		<view class="time">
			<text class="aa">类型:</text>
			 <text>{{taskDetail.type}}</text>
		</view>
		<view class="time">
			<text class="aa">订单联系人:</text>
			 <text>{{taskDetail.createdBy}}</text>
		</view>
		<view class="time">
			<text class="aa">联系手机号:</text>
			 <text>{{taskDetail.tel}}</text>
		</view>
		<view class="time">
			<text class="aa">邮箱:</text>
			 <text>{{taskDetail.email}}</text>
		</view>
		<view class="time">
			<text class="aa">业务领域:</text>
			 <text>{{taskDetail.domain}}</text>
		</view>
		<view class="time">
			<text class="aa">内容:</text>
			 <text>{{taskDetail.content}}</text>
		</view>
		<view class="time">
			<text class="aa">备注信息:</text>
			 <text>{{taskDetail.extend}}</text>
		</view>
		<view class="time">
			<text class="aa">附件:</text>
			 <text>{{taskDetail.attachment}}</text>
		</view>
		<view class="time">
			<text class="aa">评分:</text>
			 <text>{{taskDetail.rate}}</text>
		</view>
		<view class="time">
			<text class="aa">评价:</text>
			 <text>{{taskDetail.evaluate}}</text>
		</view>
		<view class="time">
			<text class="aa">处理结果:</text>
			 <text>{{taskDetail.result}}</text>
		</view>
		<view class="time">
			<text class="aa">处理结果:</text>
			 <text>{{taskDetail.result}}</text>
		</view>
		<view class="time">
			<text class="aa">创建时间:</text>
			 <text>{{taskDetail.updatedAt}}</text>
		</view>
	
		</view>
	</view>
</template>

<script setup>
import messageApi from '@/api/order'
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const taskDetail = ref({})
// 获取地址参数
onLoad((params) => {
    // 获取任务 ID 并获取详情数据
	console.log('1',params);
    getTaskDetail(params.id)
  })
async function getTaskDetail(id) {
    // if (!id) return
    const res = await   messageApi.detail(id)
	console.log(res);

	if (res.code===200) {
		taskDetail.value=res.data
		console.log(taskDetail.value);
	}else{
		uni.showToast({
     title:"获取详情失败",
     icon: 'closeempty',
     duration: 2000//持续的时间
   })
	}
    // 渲染数据
  }
//   getTaskDetail()
</script>

<style lang="scss" scoped>
.content {
		height: 100vh;
      background-color: #e9f3fe;
	  padding-top: 10px;
	}
	.container{
		width: 85%;
		margin-left: 5%;
		background-color: #fff;
		border: 1px solid #f6f8fa;
		border-radius: 10px;
		padding-left: 10px;
		padding-top: 10px;
	}
	.order{
		display: flex;
		justify-content: space-between;
		color: #8fabef;
	}
	.state{
		color: #225afd;
		padding-bottom: 10px;
	}
	.time{
		color:#000 ;
		font-size: 12px;
		margin-top: 10px;
	}
	.details{
		display: flex;
		justify-content: space-between;
margin-bottom: 10px;
	}
	.particulars{
		color: #fff;
		width: 100px;
		background-color: #225afd;
		text-align: center;
		border-radius: 50px;
		margin-bottom: 10px;
		margin-right: 10px;
	}
	.data-v-10d99fc7{
		font-size: 14px;
		color: #585a51;
	}
	.aa{
		color: #000;
	}
</style>